-
Notifications
You must be signed in to change notification settings - Fork 3k
modify dubbo plugin configuration based on selector #5953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
modify dubbo plugin configuration based on selector #5953
Conversation
...-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java
Outdated
Show resolved
Hide resolved
...-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java
Outdated
Show resolved
Hide resolved
...-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java
Outdated
Show resolved
Hide resolved
…ector' into feature/dubbo-config-base-on-selector
@Wweiei if u got time, fix the conflicts |
…g-base-on-selector # Conflicts: # db/upgrade/2.7.0-upgrade-2.7.1-mysql.sql # db/upgrade/2.7.0-upgrade-2.7.1-ob.sql # db/upgrade/2.7.0-upgrade-2.7.1-og.sql # db/upgrade/2.7.0-upgrade-2.7.1-oracle.sql # db/upgrade/2.7.0-upgrade-2.7.1-pg.sql
|
@Wweiei hi, fix the ci, pls |
…g-base-on-selector # Conflicts: # db/upgrade/2.7.0-upgrade-2.7.1-mysql.sql # db/upgrade/2.7.0-upgrade-2.7.1-ob.sql # db/upgrade/2.7.0-upgrade-2.7.1-og.sql # db/upgrade/2.7.0-upgrade-2.7.1-oracle.sql # db/upgrade/2.7.0-upgrade-2.7.1-pg.sql
@Wweiei fix ci pls |
…g-base-on-selector # Conflicts: # db/upgrade/2.7.0-upgrade-2.7.1-mysql.sql # db/upgrade/2.7.0-upgrade-2.7.1-ob.sql # db/upgrade/2.7.0-upgrade-2.7.1-og.sql # db/upgrade/2.7.0-upgrade-2.7.1-oracle.sql # db/upgrade/2.7.0-upgrade-2.7.1-pg.sql
/** | ||
* The constant string separator. | ||
*/ | ||
String SEPARATOR_UNDERLINE = "_"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is existed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have not fount the common variable in Constants.java and other class.
...henyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/resources/application.yml
Outdated
Show resolved
Hide resolved
...henyu-examples-dubbo/shenyu-examples-apache-dubbo-service/src/main/resources/application.yml
Show resolved
Hide resolved
} | ||
|
||
ReferenceConfig<GenericService> reference = new ReferenceConfig<>(); | ||
reference.setGeneric("true"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why "true"? not true?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If it set to "true", it means the generic invocation function is enabled.Otherwise, when initializing ReferenceConfig, the caller still needs to hold the Class object of the service interface.
...-dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/cache/ApacheDubboConfigCache.java
Outdated
Show resolved
Hide resolved
...dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/proxy/ApacheDubboProxyService.java
Outdated
Show resolved
Hide resolved
...dubbo/src/main/java/org/apache/shenyu/plugin/apache/dubbo/proxy/ApacheDubboProxyService.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 12 out of 22 changed files in this pull request and generated 1 comment.
Files not reviewed (10)
- db/init/mysql/schema.sql: Language not supported
- db/init/ob/schema.sql: Language not supported
- db/init/og/create-table.sql: Language not supported
- db/init/oracle/schema.sql: Language not supported
- db/init/pg/create-table.sql: Language not supported
- db/upgrade/2.7.0-upgrade-2.7.1-mysql.sql: Language not supported
- db/upgrade/2.7.0-upgrade-2.7.1-ob.sql: Language not supported
- db/upgrade/2.7.0-upgrade-2.7.1-og.sql: Language not supported
- db/upgrade/2.7.0-upgrade-2.7.1-oracle.sql: Language not supported
- db/upgrade/2.7.0-upgrade-2.7.1-pg.sql: Language not supported
complete task 4 in #5923 , modify dubbo registry config base on selector.
if the dubbo selector parameter registry is empty, it will use the default plugin config. i add a common method to get the dubbo ReferenceConfig in ApacheDubboProxyService.java#getReferenceConfig
when invoke the api 'http://localhost:9195/dubbo/findById', it will throw No provider exception.
when invoke the api the 'dubboUpstreams' is not empty in ApacheDubboProxyService.java#getReferenceConfig
then chose one upstream and create a new ReferenceConfig with a new cacheKey
finally, it will use the new ReferenceConfig to invoke the dubbo interface through the new registry。
And when use the multi registry or there are multiple Dubbo instances, the custom dubbo LoadBalance ApacheDubboGrayLoadBalance will be triggered, so when build the ReferenceConfig i didn't use reference.setLoadbalance("gray") and methodConfig.setLoadbalance("gray").
Make sure that:
./mvnw clean install -Dmaven.javadoc.skip=true
.